import { createSSRApp } from 'vue'
import App from './App.vue'
import * as Pinia from 'pinia';
import { piniaStorage } from "./js_sdk/pinia-plugin-piniastorage/dist";
import Env from './env'
import Tool from './libs/tool'
import uvUI from './uni_modules/uv-ui-tools'
import Api from './libs/api'

export function createApp() {
    const app = createSSRApp(App)
    const store = Pinia.createPinia();
    store.use(piniaStorage());
    app.use(store);
    app.use(uvUI);
    app.config.globalProperties.$env = Env
    app.config.globalProperties.$tool = Tool
    app.config.globalProperties.$api = Api
    return {
        app,
        Pinia, // 此处必须将 Pinia 返回
    }
}
